<div class="report_container">
<?php
    $arrLabels = array(
        "patologias"=> "Patolog&iacute;s",
        "objetivos"=> "Objetivos",
        "via_alimentacion"=> "Via de Alimentaci&oacute;n",
        "prescripcion"=> "Prescripci&oacute;n",
        "motivo_consulta"=> "Motivo de la Consulta",
        "farmacos" => "F&aacute;rmacos",
        "cirugias" => "Cirug&iacute;as",
        "laboratorio"=> "Laboratorio",
        "antecedentes"=> "Antecedentes",
        "historial"=> "Historial"
    );

    echo "<ul class='reporte'>";
    foreach($arrLabels as $key => $value){
        $ban = false;
        foreach($data as $r){
            $d = $r["ValoracionEvalClinicaPaciente"];
            if($d[$key] != ""){
                if(!$ban){
                    echo "<h1>".$value."</h1>";
                    $ban = true;
                }
                $fecha = new DateTime($d["fecha"]);
                echo "<div class='fecha'>".$fecha->format("d/m/Y")."</div>";
                echo "<div class='data'>".$d[$key]."</div>";
            }
        }
    }
    echo "</ul>";
?>
</div>
<style>
    .report_container{
        height: 480px;
        width: 100%;
        overflow: auto;

    }
    .reporte h1{
        font-family: sans-serif;
        font-size: 18px;
        clear: both;
        padding-top: 10px;
    }
    .fecha{
        clear: both;
        font-family: sans-serif;
    }
    .data{
        font-family: sans-serif;
        float: left;
        margin-left: 25px;
    }
}
</style>
